.class public Lde/dealdoktor/app/activities/Tabs;
.super Lde/dealdoktor/app/views/ScrollableTabActivity;
.source "Tabs.java"

# interfaces
.implements Landroid/widget/TabHost$OnTabChangeListener;


# static fields
.field public static final BROADCAST_ACTION_UPDATE:Ljava/lang/String; = "de.dealdoktor.broadcastaction.update"


# instance fields
.field private intent:Landroid/content/Intent;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 25
    invoke-direct {p0}, Lde/dealdoktor/app/views/ScrollableTabActivity;-><init>()V

    return-void
.end method

.method private resetNotificationData()V
    .locals 6

    .prologue
    const/4 v5, 0x0

    .line 65
    const-string v2, "notification"

    .line 66
    .local v2, ns:Ljava/lang/String;
    invoke-virtual {p0, v2}, Lde/dealdoktor/app/activities/Tabs;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/app/NotificationManager;

    .line 67
    .local v1, notificationManager:Landroid/app/NotificationManager;
    invoke-virtual {v1}, Landroid/app/NotificationManager;->cancelAll()V

    .line 70
    const-string v4, "dealdoktor_preferences"

    invoke-virtual {p0, v4, v5}, Lde/dealdoktor/app/activities/Tabs;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v3

    .line 71
    .local v3, settings:Landroid/content/SharedPreferences;
    invoke-interface {v3}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 72
    .local v0, editor:Landroid/content/SharedPreferences$Editor;
    const-string v4, "notificationNumber"

    invoke-interface {v0, v4, v5}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 73
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 74
    return-void
.end method


# virtual methods
.method protected onActivityResult(IILandroid/content/Intent;)V
    .locals 2
    .parameter "requestCode"
    .parameter "resultCode"
    .parameter "data"

    .prologue
    .line 132
    const-string v0, "xxxxxx"

    const-string v1, "onActivityResult"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 133
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lde/dealdoktor/app/activities/Tabs;->setCurrentTab(I)V

    .line 134
    return-void
.end method

.method public onBackPressed()V
    .locals 2

    .prologue
    .line 143
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Tabs;->getLocalActivityManager()Landroid/app/LocalActivityManager;

    move-result-object v1

    .line 144
    .local v1, activityManager:Landroid/app/LocalActivityManager;
    invoke-virtual {v1}, Landroid/app/LocalActivityManager;->getCurrentActivity()Landroid/app/Activity;

    move-result-object v0

    .line 146
    .local v0, a:Landroid/app/Activity;
    invoke-virtual {v0}, Landroid/app/Activity;->onBackPressed()V

    .line 148
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 8
    .parameter "savedInstanceState"

    .prologue
    const v7, 0x7f02000a

    const/high16 v6, 0x4000

    const/4 v5, 0x0

    const v4, 0x7f020001

    .line 31
    invoke-super {p0, p1}, Lde/dealdoktor/app/views/ScrollableTabActivity;->onCreate(Landroid/os/Bundle;)V

    .line 32
    invoke-direct {p0}, Lde/dealdoktor/app/activities/Tabs;->resetNotificationData()V

    .line 33
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Tabs;->getIntent()Landroid/content/Intent;

    move-result-object v2

    const-string v3, "startFromNotification"

    invoke-virtual {v2, v3, v5}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v1

    .line 34
    .local v1, startFromNotification:Z
    if-eqz v1, :cond_0

    .line 37
    :try_start_0
    new-instance v2, Lde/dealdoktor/app/data/DataModel;

    invoke-direct {v2}, Lde/dealdoktor/app/data/DataModel;-><init>()V

    invoke-virtual {v2, p0}, Lde/dealdoktor/app/data/DataModel;->getCategories(Landroid/content/Context;)Ljava/util/ArrayList;

    move-result-object v2

    sput-object v2, Lde/dealdoktor/app/App;->categories:Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 44
    :cond_0
    :goto_0
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    const-class v3, Lde/dealdoktor/app/activities/GroupIndex;

    invoke-virtual {v2, p0, v3}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v2

    iput-object v2, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    .line 45
    const-string v2, "Home"

    iget-object v3, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    invoke-virtual {p0, v2, v4, v3}, Lde/dealdoktor/app/activities/Tabs;->addTab(Ljava/lang/String;ILandroid/content/Intent;)V

    .line 47
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    const-class v3, Lde/dealdoktor/app/activities/GroupTopDeals;

    invoke-virtual {v2, p0, v3}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v2

    iput-object v2, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    .line 48
    const-string v2, "Top Deals"

    iget-object v3, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    invoke-virtual {p0, v2, v4, v3}, Lde/dealdoktor/app/activities/Tabs;->addTab(Ljava/lang/String;ILandroid/content/Intent;)V

    .line 50
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    const-class v3, Lde/dealdoktor/app/activities/GroupComments;

    invoke-virtual {v2, p0, v3}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v2

    iput-object v2, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    .line 51
    const-string v2, "Kommentare"

    iget-object v3, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    invoke-virtual {p0, v2, v7, v3}, Lde/dealdoktor/app/activities/Tabs;->addTab(Ljava/lang/String;ILandroid/content/Intent;)V

    .line 53
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    const-class v3, Lde/dealdoktor/app/activities/GroupForum;

    invoke-virtual {v2, p0, v3}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2, v6}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    move-result-object v2

    iput-object v2, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    .line 54
    const-string v2, "Forum"

    iget-object v3, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    invoke-virtual {p0, v2, v7, v3}, Lde/dealdoktor/app/activities/Tabs;->addTab(Ljava/lang/String;ILandroid/content/Intent;)V

    .line 56
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    const-class v3, Lde/dealdoktor/app/activities/GroupChat;

    invoke-virtual {v2, p0, v3}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2, v6}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    move-result-object v2

    iput-object v2, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    .line 57
    const-string v2, "Chat"

    iget-object v3, p0, Lde/dealdoktor/app/activities/Tabs;->intent:Landroid/content/Intent;

    invoke-virtual {p0, v2, v4, v3}, Lde/dealdoktor/app/activities/Tabs;->addTab(Ljava/lang/String;ILandroid/content/Intent;)V

    .line 59
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Tabs;->commit()V

    .line 61
    invoke-virtual {p0, v5}, Lde/dealdoktor/app/activities/Tabs;->setCurrentTab(I)V

    .line 62
    return-void

    .line 38
    :catch_0
    move-exception v0

    .line 39
    .local v0, e:Ljava/lang/Exception;
    const-string v2, "exception"

    const-string v3, "Tabs onCreate"

    invoke-static {v2, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 40
    const-string v2, "Fehler beim Initialisieren"

    const/4 v3, 0x1

    invoke-static {p0, v2, v3}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    goto/16 :goto_0
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 2
    .parameter "menu"

    .prologue
    .line 92
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Tabs;->getMenuInflater()Landroid/view/MenuInflater;

    move-result-object v0

    .line 93
    .local v0, inflater:Landroid/view/MenuInflater;
    const/high16 v1, 0x7f0a

    invoke-virtual {v0, v1, p1}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V

    .line 94
    const/4 v1, 0x1

    return v1
.end method

.method protected onNewIntent(Landroid/content/Intent;)V
    .locals 2
    .parameter "intent"

    .prologue
    .line 78
    invoke-super {p0, p1}, Lde/dealdoktor/app/views/ScrollableTabActivity;->onNewIntent(Landroid/content/Intent;)V

    .line 79
    invoke-direct {p0}, Lde/dealdoktor/app/activities/Tabs;->resetNotificationData()V

    .line 80
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lde/dealdoktor/app/activities/Tabs;->setCurrentTab(I)V

    .line 81
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    new-instance v1, Lde/dealdoktor/app/activities/Tabs$1;

    invoke-direct {v1, p0}, Lde/dealdoktor/app/activities/Tabs$1;-><init>(Lde/dealdoktor/app/activities/Tabs;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 88
    return-void
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 6
    .parameter "item"

    .prologue
    const/4 v2, 0x1

    .line 99
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v3

    packed-switch v3, :pswitch_data_0

    .line 126
    invoke-super {p0, p1}, Lde/dealdoktor/app/views/ScrollableTabActivity;->onOptionsItemSelected(Landroid/view/MenuItem;)Z

    move-result v2

    :goto_0
    return v2

    .line 101
    :pswitch_0
    sput-boolean v2, Lde/dealdoktor/app/App;->updateIndex:Z

    .line 102
    sput-boolean v2, Lde/dealdoktor/app/App;->updateTopDeals:Z

    .line 103
    sput-boolean v2, Lde/dealdoktor/app/App;->updateComments:Z

    .line 104
    new-instance v3, Landroid/content/Intent;

    const-string v4, "de.dealdoktor.broadcastaction.update"

    invoke-direct {v3, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v3}, Lde/dealdoktor/app/activities/Tabs;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    .line 107
    :pswitch_1
    new-instance v0, Lde/dealdoktor/app/dialog/ImpressumDialog;

    invoke-direct {v0, p0}, Lde/dealdoktor/app/dialog/ImpressumDialog;-><init>(Landroid/app/Activity;)V

    .line 108
    .local v0, impressumDialog:Lde/dealdoktor/app/dialog/ImpressumDialog;
    invoke-virtual {v0, v2}, Lde/dealdoktor/app/dialog/ImpressumDialog;->requestWindowFeature(I)Z

    .line 109
    invoke-virtual {v0}, Lde/dealdoktor/app/dialog/ImpressumDialog;->show()V

    goto :goto_0

    .line 112
    .end local v0           #impressumDialog:Lde/dealdoktor/app/dialog/ImpressumDialog;
    :pswitch_2
    new-instance v3, Landroid/content/Intent;

    const-class v4, Lde/dealdoktor/app/activities/Settings;

    invoke-direct {v3, p0, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {p0, v3}, Lde/dealdoktor/app/activities/Tabs;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 115
    :pswitch_3
    new-instance v3, Landroid/content/Intent;

    const-string v4, "android.intent.action.VIEW"

    const-string v5, "market://details?id=de.dealdoktor.app"

    invoke-static {v5}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    invoke-virtual {p0, v3}, Lde/dealdoktor/app/activities/Tabs;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 119
    :pswitch_4
    const/4 v1, 0x1

    .line 120
    .local v1, requestCode:I
    new-instance v3, Landroid/content/Intent;

    const-class v4, Lde/dealdoktor/app/activities/Categories;

    invoke-direct {v3, p0, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {p0, v3, v1}, Lde/dealdoktor/app/activities/Tabs;->startActivityForResult(Landroid/content/Intent;I)V

    goto :goto_0

    .line 123
    .end local v1           #requestCode:I
    :pswitch_5
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Tabs;->onSearchRequested()Z

    goto :goto_0

    .line 99
    :pswitch_data_0
    .packed-switch 0x7f0b0045
        :pswitch_0
        :pswitch_5
        :pswitch_4
        :pswitch_3
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method public onTabChanged(Ljava/lang/String;)V
    .locals 2
    .parameter "tabId"

    .prologue
    .line 138
    const-string v0, "onTabChanged"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 140
    return-void
.end method
